import { useEffect } from "react"
import { useState } from "react"
import { getChannelAPI } from "../apis/article"
const useChannel = ()=> {
const [channelList,setChannelList] = useState([])
    useEffect(()=> {
        const getChannelList = async ()=> {
            const res =  await getChannelAPI()
            setChannelList(res.data.channels)
        }
        getChannelList()
    },[])

    return {
        channelList
    }
}

export {useChannel}